<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <input type="text" onfocus="testFocus()" onblur="testBlur()" >
<script>
   function testFocus() {
       console.log("testFocus");
   }
   function testBlur() {
       console.log("testBlur");
   }
</script>

</body>
</html>